<div>
  <p>
    An agent needs to have a directory dedicated to Jenkins. Specify the path to
    this directory on the agent. It is best to use an absolute path, such as
    <code>/var/jenkins</code>
    or
    <code>c:\jenkins</code>
    . This should be a path local to the agent machine. There is no need for
    this path to be visible from the controller.
  </p>

  <p>
    Agents do not maintain important data; all job configurations, build logs
    and artifacts are stored on the controller, so it would be possible to use a
    temporary directory as the agent root directory.
    <br />
    However, by giving an agent a directory that is not deleted after a machine
    reboot, for example, the agent can cache data such as tool installations, or
    build workspaces. This prevents unnecessary downloading of tools, or
    checking out source code again when builds start to run on this agent again
    after a reboot.
  </p>

  <p>
    If you use a relative path, such as
    <code>./jenkins-agent</code>
    , the path will be relative to the working directory provided by the
    <i>Launch method</i>
    .
  </p>

  <ul>
    <li>
      For launchers where Jenkins controls starting the agent process, such as
      SSH, the current working directory will typically be consistent, e.g. the
      user's home directory.
    </li>
    <li>
      For launchers where Jenkins has no control over starting the agent
      process, such as inbound agents launched from the command line, the
      current working directory may change between launches of the agent and use
      of a relative path may prove problematic.
      <br />
      The principal issue encountered when using relative paths with inbound
      launchers is the proliferation of stale workspaces and tool installation
      on the agent machine. This can cause disk space issues.
    </li>
  </ul>
</div>
